import { IsIn, IsNotEmpty, isNotEmpty, IsNumber, isNumber, IsString, isString, Min } from "class-validator";

export class CreateStudentDto{
    @IsNotEmpty({message:'学生姓名不能为空'})
    @IsString({message:'姓名必须是字符串'})
    name:string;

     @IsNotEmpty({message:'学生年龄不能为空'})
    @IsNumber({},{message:'年龄必须是数字'})
    @Min(1,{message:'年龄不能小于1岁'})
    age:number;

    @IsNotEmpty({message:'学生性别不能为空'})
    @IsString({message:'性别必须是字符串'})
    @IsIn(["男","女"],{message:'性别只能是男女'})
    gender:string;

    @IsNotEmpty({message:'专业不能为空'})
    @IsString({message:'专业必须是字符串'})
    major:string
}